﻿// ==================================================
// Copyright © 2016 杭州伯庸科技 版权所有
//
// 文 件 名：ScreenSettings
// 功能描述：
//
// 创建标识：Yu.Liang(俞 亮) 2018/4/9 8:26:28
//
// 修改标识：
// 修改描述：
// ==================================================

using Shine.Framework;
using SuperMap.Realspace;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Shine.Tool
{
    internal class ScreenSettings : BaseCommand
    {
        IApplication m_Application = null;

        public ScreenSettings()
        {
            base.m_caption = "分屏设置";
            base.m_name = "ScreenSettings";
            base.m_toolTip = "分屏设置";
            base.m_message = "分屏设置";
            base.m_category = "tool";
        }

        public override void OnCreate(object hook)
        {
            if (m_Application == null)
            {
                m_Application = hook as IApplication;
            }
        }

        public override void OnClick()
        {
            FrmScreenSetting frm = FrmScreenSetting.Instance(m_Application);
            frm.Show((m_Application as IFramework).MdiForm);
        }

        public override int Bitmap
        {
            get
            {
                string imgFile = Application.StartupPath + "\\Images\\" + GetType().Name + ".png";

                if (System.IO.File.Exists(imgFile) == false) return 0;

                return new Bitmap(Image.FromFile(imgFile)).GetHbitmap().ToInt32();
            }
        }

        public override bool Enabled
        {
            get
            {
                return (m_Application as IFramework).IsSceneCtlActive;
            }
        }


    }
}
